<script lang="ts" setup>
import dayjs from 'dayjs'
import type {IComment} from '@/typings/interface'

const {user} = defineProps<{
    user: IComment
}>()

</script>

<template>
    <view flex items-start mb-5>
        <image w-60 h-60 rounded-full mb-5 :src="user.head_img" mode="scaleToFill"/>
        <view w-full ml-1>
            <view between mt-1>
                <text text="20 #333">
                    {{ user.username }}
                </text>
                <view center>
                    <uni-rate :size="13" readonly margin="2" allow-half color="white" active-color="#ff4439"
                              :value="user.total_point / 10 / 2"/>
                    <text text="13 #ff4439" ml-1>
                        {{ (user.total_point / 10).toFixed(1) }}分
                    </text>
                </view>
            </view>
            <text text="16 #555555">
                {{ user.content }}
            </text>
            <view between mt-2>
                <text text="14 #aaa">
                    {{ dayjs(user.gmt_create).format('YYYY-MM-DD HH:mm:ss') }}
                </text>
            </view>
        </view>
    </view>
</template>
